import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/dashboard'
    },
    {
      path: '/dashboard', name: 'dashboard',
      meta: { id: 10, title: '数据分析' },
      component: () => import(/* webpackChunkName: "dashboard" */ '../views/Index.vue')
    },
    {
      path: '/login', name: 'login',
      component: () => import('../views/Login.vue')
    }, {
      path: '/message', name: 'message',
      meta: { 'id': 10, title: '公告通知' },
      component: () => import('../views/Message.vue')
    },
    {
      path: '/banner', name: 'banner',
      meta: { 'id': 10, title: '轮播管理' },
      component: () => import('../views/Banner.vue')
    },
    {
      path: '/user', name: 'user',
      meta: { id: 20, title: '会员管理' },
      component: () => import('../views/User.vue')
    },
    {
      path: '/user/lucky', name: 'user.lucky',
      meta: { id: 20, title: '抽奖审核' },
      component: () => import('../views/user/lucky.vue')
    },
    {
      path: '/user/rule', name: 'user.rule',
      meta: { id: 20, title: '会员规则' },
      component: () => import('../views/user/rule.vue')
    },
    {
      path: '/rider', name: 'user.rider',
      meta: { id: 20, title: '骑手管理' },
      component: () => import('../views/user/rider.vue')
    },
    {
      path: '/goods/category', name: 'goods.category',
      meta: { id: 30, title: '商品分类' },
      component: () => import('../views/Category.vue'),
    },
    {
      path: '/goods', name: 'goods',
      meta: { id: 30, title: '商品分类' },
      component: () => import('../views/Goods.vue'),
    },
    {
      path: '/order', name: 'order',
      meta: { id: 40, title: '订单管理' },
      component: () => import('../views/Order.vue')
    },
    {
      path: '/order/recharge', name: 'order.recharge',
      meta: { id: 40, title: '充值记录' },
      component: () => import('../views/Recharge.vue')
    },
    {
      path: '/order/withdraw', name: 'order.withdraw',
      meta: { id: 40, title: '提现记录' },
      component: () => import('../views/Withdraw.vue')
    },
    {
      path: '/bonuspool', name: 'promoter.bonuspool',
      meta: { id: 55, title: '奖金池记录' },
      component: () => import('../views/promoter/bonuspool.vue')
    },
    {
      path: '/promission', name: 'promoter.commission',
      meta: { id: 55, title: '分佣设置' },
      component: () => import('../views/promoter/commission.vue')
    },
    {
      path: '/shop', name: 'shop',
      meta: { id: 60, title: '店铺管理' },
      component: () => import('../views/Shop.vue')
    },
    {
      path: '/maker/activity', name: 'maker.activity',
      meta: { id: 70, title: '创客会员' },
      component: () => import('../views/maker/activity.vue')
    },
    {
      path: '/maker/member', name: 'maker.member',
      meta: { id: 70, title: '创客会员' },
      component: () => import('../views/Maker.vue')
    },
    {
      path: '/config/location', name: 'location',
      meta: { id: 90, title: '定位服务' },
      component: () => import('../views/config/location.vue')
    },
    {
      path: '/config/web', name: 'webconfig',
      meta: { id: 90, title: '系统配置' },
      component: () => import('../views/config/web.vue')
    },
    {
      path: '/config/wxa', name: 'wxaconfig',
      meta: { id: 90, title: '微信配置' },
      component: () => import('../views/config/wxa.vue')
    },
    {
      path: '/config/sms', name: 'smsconfig',
      meta: { id: 90, title: '短信配置' },
      component: () => import('../views/config/sms.vue')
    },
    {
      path: '/wxa/menu',
      name: 'wxamenu',
      meta: { 'id': 90, title: '菜单配置' },
      component: () => import('../views/wxa/Menu.vue')
    },
    {
      path: '/config/foka', name: 'foka',
      meta: { id: 90, title: '福卡配置' },
      component: () => import('../views/config/foka.vue')
    },
    {
      path: '/account', name: 'account',
      meta: { id: 90, title: '修改密码' },
      component: () => import('../views/Account.vue')
    },
  ]
})

export default router
